import { ActionTree, ActionContext } from 'vuex'
import { State } from './state'
import * as actionTypes from './action-type'
import * as mutationTypes from './mutation-type'

export default {
  /**
   * 异步设置版本号
   * @param param0
   */
  [actionTypes.SET_VERSION]: ({ commit }: ActionContext<State, any>, version: string) => {
    setTimeout(() => {
      commit(mutationTypes.SET_VERSION, version)
    })
  },
} as ActionTree<State, any>
